﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

using MyManagementDAL;
using DbMyManagement;

namespace MankindBLL
{
    public sealed class UserUtility
    {
        DbConnDataContext _Dal = new DbConnDataContext();

        #region 基本，增删改查

        System.Data.Linq.Table<t_User> BaseTable
        {
            get
            {
                return _Dal.t_User;
            }
        }

        //获取指定账号的用户实体
        public t_User GetUserByAccount(string account)
        {
            return BaseTable.FirstOrDefault(D => D.Account == account);
        }

        //删除指定用户

        //修改指定用户的实体

        //增加用户
        public void AddUser(t_User user)
        {
            user.UserID = Guid.NewGuid().ToString();
            user.Salt = Guid.NewGuid().ToString();



            BaseTable.InsertOnSubmit(user);
        }

        #endregion
    }
}
